<?php
include '../controllers/QuestionController.php';
$questionId = $_REQUEST ['questionId'];
$question = getQuestionById ( $questionId );

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="../js/question.js"></script>
</head>
<body>
	<a href='../index.php'>返回首页</a>
	<h1>问题墙</h1>
	<hr />
	<?php
	$formatTime = date ( "y-m-d h:i:s", $question->timestamp );
	?>
		<table border='2' rules='rows' cellpadding='8%' align='center'
		width='80%'>
		<tr>
			<th>问题标题</th>
			<td><?php echo $question->title;?></td>
		</tr>

		<tr>
			<th>问题详情</th>
			<td><?php echo $question->content;?></td>
		</tr>

		<tr>
			<th>提问时间</th>
			<td><?php echo $formatTime;?></td>
		</tr>

		<tr>
			<td colspan=2>
				<table border='2' rules='rows' cellpadding='8%' align='center'>
					<tr>
						<th>回答老师</th>
						<td><input type="text" id="nickname" size="20"></input></td>
					</tr>
					<tr>
						<th>老师说明</th>
						<td><input type="text" id="introduce" size="100"></input></td>
					</tr>
					<tr>
						<th>回答内容</th>
						<td><textarea rows="4" cols="50" id="content"></textarea></td>
					</tr>

					<tr>
						<td colspan=2><input type="button" value="提交问题"
							onclick="addAnswer(<?php echo $question->questionId;?>);"></input></td>

					</tr>

				</table>
			</td>
		</tr>

	</table>
</body>
</html>